package com.atguigu.yygh.cmn.excel;

import com.alibaba.excel.EasyExcel;

import java.util.ArrayList;
import java.util.List;

public class EasyExcelWrite {

    private static List<Student> data() {
        List<Student> list = new ArrayList<Student>();
        for (int i = 0; i < 10; i++) {
            Student data = new Student();
            data.setId(i);
            data.setName("张三"+i);
            list.add(data);
        }
        return list;
    }

    public static void main(String[] args) {
        EasyExcel.write("D:\\Users\\Administrator\\Desktop\\1.xlsx",Student.class)
                .sheet()
                .doWrite(data());
    }
}
